Skip to content

[win] Fix wsl2 menu display issues#22453

Closed
bellenot wants to merge 1 commit into
root-project:masterfrom
bellenot:fix-17483
Closed

[win] Fix wsl2 menu display issues#22453
bellenot wants to merge 1 commit into
root-project:masterfrom
bellenot:fix-17483

Conversation

@bellenot

@bellenot bellenot commented Jun 2, 2026

Copy link
Copy Markdown
Member

Fixes #17483

@bellenot bellenot self-assigned this Jun 2, 2026
@bellenot bellenot requested a review from couet as a code owner June 2, 2026 08:30
@dpiparo dpiparo requested a review from linev June 2, 2026 10:16
@linev

linev commented Jun 2, 2026

Copy link
Copy Markdown
Member

You changing implementation of TGX11::ChangeProperty method - which is used in other places.

GTK has other way to specify that:

gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_TOOLTIP);

And Cocoa does not use it at all - but method QuartzWindow::setProperty will be invoked.

So maybe just provide TVirtualX::SetWindowTypeHintTooltip(wid) or similar?
And implement it for X11 and gtk?

@bellenot

bellenot commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

You changing implementation of TGX11::ChangeProperty method - which is used in other places.

GTK has other way to specify that:

gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_TOOLTIP);

And Cocoa does not use it at all - but method QuartzWindow::setProperty will be invoked.

So maybe just provide TVirtualX::SetWindowTypeHintTooltip(wid) or similar? And implement it for X11 and gtk?

Sure, I can make the changes for Windows only. Does it create any side effects on Linux and/or MacOS?

@linev

linev commented Jun 2, 2026

Copy link
Copy Markdown
Member

Does it create any side effects on Linux and/or MacOS?

I do not know. But seems to be approach you apply should be use only with X11 and GTK.

@bellenot

bellenot commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

Does it create any side effects on Linux and/or MacOS?

I do not know. But seems to be approach you apply should be use only with X11 and GTK.

OK, well, that will make it more complicated, but I'll check how I can do it

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 9h 11m 49s ⏱️
 3 864 tests  3 812 ✅ 0 💤 52 ❌
76 236 runs  76 183 ✅ 1 💤 52 ❌

For more details on these failures, see this check.

Results for commit 8d61fa7.

@bellenot

bellenot commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

@linev BTW, that has nothing to do with GTK, it's pure X11 code, not Windows at all! And I'm not sure if can detect when the code is running in WSL...

@linev

linev commented Jun 2, 2026

Copy link
Copy Markdown
Member

that has nothing to do with GTK, it's pure X11 code, not Windows at all!

Yes, but you are using gVirtualX->ChangeProperty() call which implemented in Cocoa and GTK as well.
And you modify argument inside TGX11::ChangeProperty() implementation.

I am fine if you are sure that such changes has no side effects.


XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
8, PropModeReplace, data, len);
32, PropModeReplace, data, len);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this change. You declare data as array of 32-bit values - but before it was array of 8-bit values.
Any call to gVirtualX->ChangeProperty() with len > 1 will definitely get a problems because of this change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly this is happens in TGTextView and TGTextEntry - there characters arrays are supplied.

@bellenot bellenot Jun 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. 32 is the format and according to the doc (https://tronche.com/gui/x/xlib/window-information/XChangeProperty.html) :
format : Specifies whether the data should be viewed as a list of 8-bit, 16-bit, or 32-bit quantities. Possible values are 8, 16, and 32.
Nothing to do with the length. Or did I miss something?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length is not changed - it provided from outside.
But it defines how many elements are in the data array.
And argument 8 says that data should be interpreted as 8-bit integer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now what? I can only detect it we run in WSL at run time...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I proposed - one introduce TVirtualX::SetWindowHintTooltip(wid) method and implements it in TGX11 and TGWin32.

In the TGX11 implementation one can directly use XChangeProperty function with any required arguments.

And in TGWin32 one can use gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_TOOLTIP)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care about gdk and TGWin32! This is pure X11 code on Linux only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then just keep implementation empty for them.

@bellenot bellenot closed this Jun 2, 2026
@bellenot bellenot deleted the fix-17483 branch June 2, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wsl2 menu display issue

2 participants